# -*- coding: utf-8 -*-

from flask.ext.wtf import Form
from wtforms import TextField, validators, TextAreaField, HiddenField

strip_filter = lambda x: x.strip() if x else None


class ArticleCreateForm(Form):
    title = TextField('Title', [validators.Required("Please enter title.")], filters=[strip_filter])
    body = TextAreaField('Body', [validators.Required("Please enter body.")], filters=[strip_filter])


class ArticleUpdateForm(ArticleCreateForm):
    id = HiddenField()
